
package com.bsg.upm.constant;

import java.util.HashMap;
import java.util.Map;

/**
 * 
 * @author yucs
 *
 */
public class MonitorCommonMap {

	public final static String CONTAINER_TYPE = "container";
	public final static String HOST_TYPE = "host";
	
	public final static String EVENT_LEVEL_INFO = "info";
	public final static String EVENT_LEVEL_NORMAL = "normal";
	public final static String EVENT_LEVEL_WARNING= "warning";
	public final static String EVENT_LEVEL_CRITICAL = "critical";
	
	private final static Map<String, String> levelMap = new HashMap<String, String>();

	static {
		levelMap.put(EVENT_LEVEL_INFO, "信息");
		levelMap.put(EVENT_LEVEL_NORMAL, "良好");
		levelMap.put(EVENT_LEVEL_WARNING, "警告");
		levelMap.put(EVENT_LEVEL_CRITICAL, "严重");
	}

	public static String getLevelName(String key) {
		return levelMap.get(key);
	}

	/*
	 * public final static String MYSQL_TYPE = "mysql"; public final static
	 * String REDIS_TYPE = "redis";
	 * 
	 * private final static Map<String, Map<String, String>> maps = new
	 * HashMap<String, Map<String, String>>(); private final static Map<String,
	 * String> metricSpecMap = new HashMap<String, String>();
	 * 
	 * static { Map<String, String> containerMap = new HashMap<String,
	 * String>();
	 * 
	 * containerMap.put("avg_cpu_usage", "container.avg_cpu_usage");
	 * 
	 * containerMap.put("all_cpu_usage", "container.all_cpu_usage");
	 * 
	 * containerMap.put("mem_usage", "container.mem_usage");
	 * 
	 * maps.put(CONTAINER_TYPE, containerMap); }
	 * 
	 * static { Map<String, String> mysqlMap = new HashMap<String, String>();
	 * 
	 * mysqlMap.put("buffer_pool_hit", "unit_mysql.buffer_pool_hit");
	 * 
	 * mysqlMap.put("buffer_pool_size", "unit_mysql.buffer_pool_size");
	 * 
	 * mysqlMap.put("buffer_pool_free_size",
	 * "unit_mysql.buffer_pool_free_size");
	 * 
	 * mysqlMap.put("buffer_pool_usage", "unit_mysql.buffer_pool_usage");
	 * 
	 * mysqlMap.put("buffer_pool_dirty_page",
	 * "unit_mysql.buffer_pool_dirty_page");
	 * 
	 * mysqlMap.put("connection_max", "unit_mysql.connection_max");
	 * 
	 * mysqlMap.put("connection_attempts", "unit_mysql.connection_attempts");
	 * 
	 * mysqlMap.put("connection_usage", "unit_mysql.connection_usage");
	 * 
	 * mysqlMap.put("exec_thread", "unit_mysql.exec_thread");
	 * 
	 * mysqlMap.put("thread_cache_usage", "unit_mysql.thread_cache_usage");
	 * 
	 * mysqlMap.put("error_file_size", "unit_mysql.error_file_size");
	 * 
	 * mysqlMap.put("slow_query_file_size", "unit_mysql.slow_query_file_size");
	 * 
	 * mysqlMap.put("table_size", "unit_mysql.table_size");
	 * 
	 * mysqlMap.put("datadir_total", "unit_mysql.datadir_total");
	 * 
	 * mysqlMap.put("datadir_application_amount",
	 * "unit_mysql.datadir_application_amount");
	 * 
	 * mysqlMap.put("logdir_total", "unit_mysql.logdir_total");
	 * 
	 * mysqlMap.put("logdir_application_amount",
	 * "unit_mysql.logdir_application_amount");
	 * 
	 * mysqlMap.put("lock_wait_info", "unit_mysql.lock_wait_info");
	 * 
	 * mysqlMap.put("com_delete", "unit_mysql.com_delete");
	 * 
	 * mysqlMap.put("com_insert", "unit_mysql.com_insert");
	 * 
	 * mysqlMap.put("com_select", "unit_mysql.com_select");
	 * 
	 * mysqlMap.put("com_update", "unit_mysql.com_update");
	 * 
	 * mysqlMap.put("mysql_io", "unit_mysql.mysql_io");
	 * 
	 * mysqlMap.put("mysql_sql", "unit_mysql.mysql_sql");
	 * 
	 * mysqlMap.put("process_check", "unit_mysql.innodb_open_table");
	 * 
	 * mysqlMap.put("process_check", "unit_mysql.process_check");
	 * 
	 * mysqlMap.put("replication_status", "unit_mysql.replication_status");
	 * 
	 * mysqlMap.put("slowlog", "unit_mysql.slowlog");
	 * 
	 * mysqlMap.put("service_status", "unit_mysql.service_status");
	 * 
	 * // 组合监控项 mysqlMap.put("load",
	 * "com_delete;com_insert;com_select;com_update");
	 * 
	 * maps.put(MYSQL_TYPE, mysqlMap); }
	 * 
	 * public static Boolean isSpecMetric(String key) {
	 * 
	 * if (metricSpecMap.containsKey(key)) { return true; }
	 * 
	 * return false; }
	 * 
	 * public static Boolean isExist(String type, String key) {
	 * 
	 * if (!maps.containsKey(type)) { return false; }
	 * 
	 * Map<String, String> metricMap = maps.get(type); if
	 * (!metricMap.containsKey(type)) { return false; }
	 * 
	 * return true; }
	 * 
	 * public static String getMetric(String type, String key) { String value =
	 * null;
	 * 
	 * if (!maps.containsKey(type)) { return value; }
	 * 
	 * Map<String, String> metricMap = maps.get(type); if
	 * (!metricMap.containsKey(type)) { return value; }
	 * 
	 * return metricMap.get(key); }
	 */

}